const { contextBridge, ipcRenderer, clipboard, remote, shell } = require('electron')


contextBridge.exposeInMainWorld('electronAPI', {
    node: () => process.versions.node,
    chrome: () => process.versions.chrome,
    clipboard: (str) => {clipboard.writeText(str)},
    connectNfc: () => ipcRenderer.send('connectNfc'),
    onUpdateDeviceMsg: (callback) => ipcRenderer.on('updateDeviceMsg', callback),
    onUpdateNfcMsg: (callback) => ipcRenderer.on('updateNfcMsg', callback)
    // 除函数之外，我们也可以暴露变量
  })

